-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fill level change api #8
base: main
Are you sure you want to change the base?
Conversation
@@ -53,7 +57,7 @@ initializeMQTT(globalEventEmitter); | |||
|
|||
// Middleware | |||
app.use(bodyParser.json()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the new middleware, that you added, we dont need this line anymore, right? How about moving line 25 and 26 to here and removing the bodyparser.json?
if (!user.projects.includes(updatedProject._id)) { | ||
user.projects.push(updatedProject._id); | ||
if (!user?.projects.includes(updatedProject._id ) && user) { | ||
console.log("users",user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove log
|
||
if (projectQuery) { | ||
// Check if the projectQuery is a valid ObjectId | ||
if (mongoose.Types.ObjectId.isValid(projectQuery)) { | ||
// console.log("Querying trashbins by ObjectId:", projectQuery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out log
trashbins = await Trashbin.find({ project: projectQuery }) | ||
.populate('assignee') | ||
.populate('project'); | ||
} else { | ||
//console.log("Querying trashbins by project identifier:", projectQuery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out log
if (project) { | ||
trashbins = await Trashbin.find({ project: project._id }) | ||
.populate('assignee') | ||
.populate('project'); | ||
// console.log("Fetched trashbins:", trashbins); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out log
@@ -1,11 +1,13 @@ | |||
import { generateUniqueTrashbinIdentifier } from '../service/trashbin'; | |||
import { Project } from '../models/project'; | |||
import { Trashbin } from '../models/trashbin'; | |||
import { History } from '../models/history'; | |||
import { Types } from 'mongoose'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you check for example line 151 you can see, that they were already referencing mongoose.Types. So I would propose to either remove this import and do line 411 with "mongoose.Types" or change the other references to just "Types" and removing the import in line 7.
Whichever you prefer
No description provided.